package org.jupiter.blog.service.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jupiter.blog.api.domain.JupiterPermission;

import java.util.List;

@Mapper
public interface JupiterPermissionMapper {

	int insert(JupiterPermission permission);

	JupiterPermission selectByUuid(@Param("uuid") String uuid);

	List<JupiterPermission> selectAll();

	int updateByUuidSelective(JupiterPermission permission);

	int deleteByUuid(@Param("uuid") String uuid);

	int restoreByUuid(@Param("uuid") String uuid);

	List<JupiterPermission> selectByPage(
			@Param("name") String name,
			@Param("code") String code,
			@Param("type") String type,
			@Param("offset") int offset,
			@Param("limit") int limit
	);

	long countByQuery(@Param("name") String name, @Param("code") String code, @Param("type") String type);

	List<JupiterPermission> selectTree();

	List<JupiterPermission> selectByRoleId(@Param("roleId") String roleId);

	long countByCode(@Param("code") String code);
}
